package com.atguigu.springcloud.entities;

import com.atguigu.springcloud.enums.EnumEO;
import lombok.Data;
import org.springframework.data.jpa.domain.support.AuditingEntityListener;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.EntityListeners;
import javax.persistence.Table;

/**
 * Created by luojie on 2018/9/7.
 */
@Data
@Entity
@Table(name = "ep_employee")
@EntityListeners(AuditingEntityListener.class)
public class Employee extends BaseEntity {

    @Column(nullable = false)
    private String name;

    private Integer age;

    @Column(nullable = false)
    private String address;

    @Column(nullable = false)
    private EnumEO.Gender gender;

    @Column(nullable = false)
    private EnumEO.Availability  availability;

    @Override
    public String toString() {
        return "Employee{" +
                "name='" + name + '\'' +
                ", age=" + age +
                ", address='" + address + '\'' +
                ", gender=" + gender +
                ", availability=" + availability +
                '}' + super.toString();
    }
}
